package com.thf.controller.user;

import com.alibaba.fastjson.JSON;
import com.thf.service.UserService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.ServletException;
import java.io.IOException;
import java.util.Map;


@Controller
public class UserGetCountController{

    @Resource
    private  UserService userService ;

    @RequestMapping("/user/count")
    @ResponseBody
    protected Integer userGetCount(String val) throws ServletException, IOException {
        Map map = JSON.parseObject(val, Map.class);
        Integer count = userService.getCount(map);
        return count ;
    }
}
